//(
 function suggest(kw,fm) {
    var M = navigator.userAgent.indexOf("MSIE") != -1 && !window.opera;
    var V = (document.compatMode == "BackCompat");
    function I(C) {
        return document.getElementById(C)
    }
    function K(C) {
        return document.createElement(C)
    }
    function S(C) {
        return String(C).replace(new RegExp("(^[\\s\\t\\xa0\\u3000]+)|([\\u3000\\xa0\\s\\t]+\x24)", "g"), "")
    }
    function U(C) {
        return String(C).replace(new RegExp("[\\s\\t\\xa0\\u3000]", "g"), "")
    }
    function P(G, X, C) {
        if (M) {
            G.attachEvent("on" + X, (function(Y) {
                return function() {
                    C.call(Y)
                }
            })(G))
        } else {
            G.addEventListener(X, C, false)
        }
    }
    function N(C) {
        if (M) {
            C.returnValue = false
        } else {
            C.preventDefault()
        }
    }
    function R(X) {
        if (M) {
            var G = document.createStyleSheet();
            G.cssText = X
        } else {
            var C = document.createElement("style");
            C.type = "text/css";
            C.appendChild(document.createTextNode(X));
            document.getElementsByTagName("HEAD")[0].appendChild(C)
        }
    }
    function H(G) {
        var X = document.forms[fm];
        for (var Y in G) {
            if (!O(Y)) {
                X.appendChild(C(Y, G[Y]))
            } else {
                O(Y).value = G[Y]
            }
        }
        function C(Z, b) {
            var a = K("INPUT");
            a.type = "hidden";
            a.name = Z;
            a.id = "bdsug_ipt_" + Z;
            a.value = b;
            return a
        }
    }
    function O(Y) {
        var X = document.forms[fm];
        var G = false;
        var C = X.getElementsByTagName("INPUT");
        for (var Z = 0; Z < C.length; Z++) {
            if (Y == C[Z].getAttribute("name")) {
                G = C[Z];
                return G
            } else {
                G = false
            }
        }
    }
    function L(G) {
        var X = document.forms[fm];
        for (var C in G) {
            if (C == fm) {
                if (O(fm)) {
                    if (O(fm).id == "bdsug_ipt_f") {
                        X.removeChild(I("bdsug_ipt_f"))
                    } else {
                        O(fm).value = "8"
                    }
                }
            } else {
                if (I("bdsug_ipt_" + C)) {
                    X.removeChild(I("bdsug_ipt_" + C))
                }
            }
        }
    }
    var A = 0;
    if (typeof window.bdsug != "object" || window.bdsug == null) {
        window.bdsug = {}
    }
    bdsug.sug = {};
    bdsug.sugkeywatcher = {};
    var J = (function() {
        function C(b) {
            var Z = this.__MSG_QS__;
            if (!Z[b]) {
                Z[b] = []
            }
            for (var a = 1, X = arguments.length, Y; a < X; a++) {
                Z[b].push(arguments[a])
            }
        }
        function G(Y) {
            var Z = this.__MSG_QS__[Y.type];
            if (Z == null) {
                return
            }
            for (var a = 0, X = Z.length; a < X; a++) {
                Z[a].rm(Y)
            }
        }
        return {
            ini: function(X) {
                X.__MSG_QS__ = {};
                X.on = C;
                X.dm = G;
                return X
            }
        }
    })();
    var F = (function() {
        var X = I(kw);
        var f;
        var h = 0;
        var C = 0;
        var d = "";
        var Y = "";
        var c;
        var j = false;
        var a = true;
        function Z() {
            if (a) {
                A = new Date().getTime();
                F.dm({
                    type: "start"
                });
                a = false
            }
        }
        function e(n) {
            if (a) {
                A = new Date().getTime();
                F.dm({
                    type: "start"
                });
                a = false
            }
            n = n || window.event;
            if (n.keyCode == 9 || n.keyCode == 27) {
                F.dm({
                    type: "hide_div"
                })
            }
            if (n.keyCode == 13) {
                N(n);
                F.dm({
                    type: "key_enter"
                })
            }
            if (n.keyCode == 86 && n.ctrlKey) {
                H({
                    n: 2
                })
            }
            if (f.style.display != "none") {
                if (n.keyCode == 38) {
                    N(n);
                    F.dm({
                        type: "key_up"
                    })
                }
                if (n.keyCode == 40) {
                    F.dm({
                        type: "key_down"
                    })
                }
            } else {
                if (n.keyCode == 38 || n.keyCode == 40) {
                    F.dm({
                        type: "need_data",
                        wd: X.value
                    })
                }
            }
        }
        function k() {
            var n = X.value;
            if (n == d && n != "" && n != Y && n != c) {
                if (C == 0) {
                    C = setTimeout(function() {
                        F.dm({
                            type: "need_data",
                            wd: n
                        })
                    },
                    100)
                }
            } else {
                clearTimeout(C);
                C = 0;
                d = n;
                if (n == "") {
                    F.dm({
                        type: "hide_div"
                    })
                }
                if (Y != X.value) {
                    Y = ""
                }
            }
        }
        function l() {
            h = setInterval(k, 10)
        }
        function g() {
            clearInterval(h)
        }
        function i() {
            if (j) {
                window.event.cancelBubble = true;
                window.event.returnValue = false;
                j = false
            }
        }
        function b(n) {
            X.blur();
            X.setAttribute("autocomplete", n);
            X.focus()
        }
        function G(n) {
            var n = n || window.event;
            if (n.keyCode == 13) {
                N(n)
            }
        }
        X.setAttribute("autocomplete", "off");
        var m = false;
        bdsug.sugkeywatcher.on = function() {
            if (!m) {
                if (M) {
                    X.attachEvent("onkeydown", e)
                } else {
                    X.addEventListener("keydown", e, false)
                }
                m = true
            }
        };
        bdsug.sugkeywatcher.off = function() {
            if (m) {
                if (M) {
                    X.detachEvent("onkeydown", e)
                } else {
                    X.removeEventListener("keydown", e, false)
                }
                m = false
            }
        };
        bdsug.sugkeywatcher.on();
        P(X, "mousedown", Z);
        P(X, "beforedeactivate", i);
        if (window.opera) {
            P(X, "keypress", G)
        }
        return J.ini({
            rm: function(n) {
                switch (n.type) {
                case "div_ready":
                    f = n.sdiv;
                    Y = X.value;
                    l();
                    break;
                case "clk_submit":
                    g();
                    X.blur();
                    X.value = n.wd;
                    break;
                case "ent_submit":
                    g();
                    X.blur();
                    break;
                case "key_select":
                    c = n.selected;
                    break;
                case "close":
                    g();
                    b("on");
                    break;
                case "mousedown_tr":
                    if (navigator.userAgent.toLowerCase().indexOf("webkit") != -1) {
                        g();
                        setTimeout(l, 2000)
                    }
                    j = true;
                    break
                }
            }
        })
    })();
    var W = (function() {
        var h;
        var a = I(kw);
        var l;
        var d = -1;
        var C;
        var m;
        var o;
        function n() {
            var r = l.rows;
            for (var q = 0; q < r.length; q++) {
                r[q].className = "ml"
            }
        }
        function e() {
            if (typeof(l) != "undefined" && l != null && h.style.display != "none") {
                var r = l.rows;
                for (var q = 0; q < r.length; q++) {
                    if (r[q].className == "mo") {
                        return [q, r[q].cells[0].innerHTML]
                    }
                }
            }
            return [ - 1, ""]
        }
        function i() {
            if (M) {
                o.style.display = "none"
            }
            h.style.display = "none"
        }
        function G() {
            n();
            this.className = "mo"
        }
        function b(q) {
            W.dm({
                type: "mousedown_tr"
            });
            if (!M) {
                q.stopPropagation();
                q.preventDefault();
                return false
            }
        }
        function c(q) {
            var r = q;
            return function() {
                var s = C[r];
                i();
				I(kw).value = s;
				I(kw).focus();
                /*W.dm({
                    type: "clk_submit",
                    oq: I(kw).value,
                    wd: s,
                    rsp: r
                })*/
            }
        }
        function f(q) {
            q = q || window.event;
            N(q);
            W.dm({
                type: "close"
            });
            i(); //(new Image()).src = "http://www.gpsoo.new/w.gif?fm=suggestion&title=%B9%D8%B1%D5&t=" + new Date().getTime()
        }
        function X() {
            var q = [a.offsetWidth, a.offsetHeight];
            h.style.width = ((M && V) ? q[0] : q[0] - 2) + "px";
            h.style.top = ((M && V) ? q[1] : q[1] - 1) + "px";
            h.style.display = "block";
            if (M) {
                o.style.top = ((M && V) ? q[1] : q[1] - 1) + "px";
                o.style.width = ((M && V) ? q[0] : q[0] - 2) + "px"
            }
        }
        function Y(r, q) {
            if (r && q) {
                var s = S(r);
                if (q.indexOf(s) == 0) {
                    q = p(q, s)
                } else {
                    if (q.indexOf(U(r)) == 0) {
                        s = U(r);
                        q = p(q, s)
                    } else {}
                }
            }
            q = q.replace("&", "&amp;");
            return q
        }
        function p(q, s) {
            var t = "<span>" + s + "</span>";
            var u = s.length;
            var r = "<b>" + q.substring(u) + "</b>";
            return (t + r)
        }
        function j() {
            l = K("TABLE");
            l.id = "st";
            l.cellSpacing = 0;
            l.cellPadding = 2;
            var s = K("tbody");
            l.appendChild(s);
            for (var t = 0, u = C.length; t < u; t++) {
                var r = s.insertRow( - 1);
                P(r, "mouseover", G);
                P(r, "mouseout", n);
                P(r, "mousedown", b);
                P(r, "click", c(t));
                var q = r.insertCell( - 1);
                q.innerHTML = Y(m, C[t])
            }
            h.innerHTML = "";
            h.appendChild(l);
            X();
            if (M) {
                o.style.display = "block";
                o.style.left = 0 + "px";
                o.style.top = a.offsetHeight + "px";
                o.style.width = a.offsetWidth + "px";
                o.style.height = h.offsetHeight - 10 + "px"
            }
        }
        function Z() {
            d = e()[0];
            if (d == -1) {
                W.dm({
                    type: "submit"
                })
            } else {
                W.dm({
                    type: "ent_submit",
                    oq: m,
                    wd: e()[1],
                    rsp: d
                })
            }
        }
        function k() {
            d = e()[0];
            n();
            if (d == 0) {
                W.dm({
                    type: "key_select",
                    selected: ""
                });
                I(kw).value = m;
                d--;
                L({
                    oq: m,
                    sug: C[d],
                    n: 1,
                    rsp: d,
                    f: 3
                })
            } else {
                if (d == -1) {
                    d = C.length
                }
                d--;
                var q = l.rows[d];
                q.className = "mo";
                W.dm({
                    type: "key_select",
                    selected: C[d]
                });
                I(kw).value = C[d];
                H({
                    oq: m,
                    sug: C[d],
                    n: 1,
                    rsp: d,
                    f: 3
                })
            }
        }
        function g() {
            d = e()[0];
            n();
            if (d == C.length - 1) {
                W.dm({
                    type: "key_select",
                    selected: ""
                });
                I(kw).value = m;
                d = -1;
                L({
                    oq: m,
                    sug: C[d],
                    n: 1,
                    rsp: d,
                    f: 3
                })
            } else {
                d++;
                var q = l.rows[d];
                q.className = "mo";
                W.dm({
                    type: "key_select",
                    selected: C[d]
                });
                I(kw).value = C[d];
                H({
                    oq: m,
                    sug: C[d],
                    n: 1,
                    rsp: d,
                    f: 3
                })
            }
        }
        return J.ini({
            rm: function(q) {
                switch (q.type) {
                case "div_ready":
                    h = q.sdiv;
                    o = q.frm;
                    break;
                case "give_data":
                    m = q.data.q;
                    C = q.data.s;
                    if (C.length != 0) {
                        j()
                    } else {
                        i()
                    }
                    break;
                case "key_enter":
                    Z();
                    break;
                case "key_up":
                    k();
                    break;
                case "key_down":
                    g();
                    break;
                case "hide_div":
                    i();
                    break;
                case "mousedown_other":
                    i();
                    break;
                case "window_blur":
                    i();
                    break;
                case "need_resize":
                    X();
                    break
                }
            }
        })
    })();
    var T = (function() {
					  //alert(fm)
        var C = document.forms[fm];
        function G() {
            if (I("bdsug_ipt_sug")) {
                if (I("bdsug_ipt_sug").value == S(I(kw).value)) {
                    L({
                        n: 1,
                        sug: 1
                    })
                } else {
                    L({
                        f: 1
                    })
                }
            }
        }
        P(C, "submit", G);
        function X() {
            G();
            //C.submit()
        }
        function Y(Z) {
            H(Z);
            L({
                sug: 1,
                n: 1
            });
            //C.submit()
        }
        return J.ini({
            rm: function(Z) {
                switch (Z.type) {
                case "clk_submit":
                case "ent_submit":
                    Y({
                        oq:
                        Z.oq,
                        rsp: Z.rsp,
                        f: 3,
                        sugT: (new Date().getTime() - A)
                    });
                    break;
                case "submit":
                    X();
                    break
                }
            }
        })
    })();
    var B = (function() {
        var G = {};
        function X(C) {
            if (typeof G[C] == "undefined") {
                B.dm({
                    type: "request_data",
                    wd: C
                })
            } else {
                B.dm({
                    type: "give_data",
                    data: G[C]
                })
            }
        }
        function Y(C) {
        	if(C && C.q){
	            G[C.q] = C;
	            B.dm({
	                type: "give_data",
	                data: G[C.q]
	            });
        	}
        }
        return J.ini({
            rm: function(C) {
                switch (C.type) {
                case "response_data":
                    Y(C.data);
                    break;
                case "need_data":
                    X(C.wd);
                    break
                }
            }
        })
    })();
    var Q = (function() {
        var C;
        var X;
        function G(Y) {
            Q.dm({
                type: "request_data"
            });
            if (C) {
                document.body.removeChild(C)
            }
            C = K("SCRIPT");
            C.src = suggestUrl+"&wd=" + encodeURIComponent(Y) + "&callback=window.bdsug.sug&t=" + (new Date()).getTime();
            //C.charset = "gb2312";
            document.body.appendChild(C)
        }
        return J.ini({
            rm: function(Y) {
                switch (Y.type) {
                case "request_data":
                    G(Y.wd);
                    break;
                case "give_cookie":
                    var Z = Y.sug;
                    if (Z > 0) {
                        Z = 3
                    }
                    X = Z;
                    break
                }
            }
        })
    })();
    bdsug.sug = function(C) {
        bdsug.dm({
            type: "response_data",
            data: C
        })
    };
    bdsug.initSug = function() {
        bdsug.dm({
            type: "init"
        })
    };
    J.ini(bdsug);
    var E = (function() {
        function C() {
            if (navigator.cookieEnabled) {
                document.cookie = "su=0; domain=www.goocar.net"
            }
        }
        function G() {
            var X = (navigator.cookieEnabled && /sug=(\d)/.test(document.cookie) ? RegExp.$1: 3);
            E.dm({
                type: "give_cookie",
                sug: X
            })
        }
        return J.ini({
            rm: function(X) {
                switch (X.type) {
                case "close":
                    C();
                    break;
                case "need_cookie":
                    G();
                    break
                }
            }
        })
    })();
    var D = (function() {
        var Z = I(kw);
        var C;
        var c = document.forms[fm];
        var Y;
        function a() {
            if (C.offsetWidth != 0 && Z.offsetWidth != C.offsetWidth) {
                D.dm({
                    type: "need_resize"
                })
            }
        }
        function d() {
            C = K("DIV");
            C.id = "sd_" + new Date().getTime();
            C.style.display = "none";
            c.appendChild(C);
            if (M) {
                Y = K("IFRAME");
                Y.style.display = "none";
                Y.style.position = "absolute";
                C.parentNode.insertBefore(Y, C)
            }
        }
        function b(e) {
            e = e || window.event;
            var f = e.target || e.srcElement;
            if (f == Z) {
                return
            }
            while (f = f.parentNode) {
                if (f == C) {
                    return
                }
            }
            D.dm({
                type: "mousedown_other"
            })
        }
        function X() {
            D.dm({
                type: "window_blur"
            })
        }
        function G() {
            var f = "#" + C.id;
            var e = [];
            D.dm({
                type: "div_ready",
                sdiv: C,
                frm: Y
            });
            setInterval(a, 100);
            P(document, "mousedown", b);
            P(window, "blur", X);
            e.push(f + "{border:1px solid #817F82;position:absolute;top:28px;left:0;height:auto;}");
            e.push(f + " table{width:100%;background:#fff;cursor:default}");
            e.push(f + " td{font:14px verdana;line-height:20px;text-indent:6px;color:#000;}");
            e.push(f + " td b{color:#333}");
            e.push(f + " .mo{background-color:#E2EAFF;}");
            e.push(f + " .ml{background-color:#fff;}");
            R(e.join(""))
        }
        bdsug.sug.initial = G;
        return J.ini({
            rm: function(e) {
                switch (e.type) {
                case "start":
                    G();
                    break;
                case "init":
                    d();
                    break
                }
            }
        })
    })();
    F.on("need_data", B);
    F.on("close_div", W);
    F.on("key_enter", W);
    F.on("key_up", W);
    F.on("key_down", W);
    F.on("hide_div", W);
    F.on("start", D);
    B.on("request_data", Q);
    B.on("give_data", W);
    bdsug.on("response_data", B);
    bdsug.on("init", D);
    W.on("clk_submit", F, T);
    W.on("ent_submit", F, T);
    W.on("submit", T);
    W.on("key_select", F);
    W.on("close", F, E);
    W.on("mousedown_tr", F);
    D.on("mousedown_other", W);
    D.on("need_resize", W);
    D.on("div_ready", F, W);
    D.on("window_blur", W);
    Q.on("need_cookie", E);
    E.on("give_cookie", Q);
    window.bdsug.initSug()
}//)('imeiName','f')
suggest('imeiName','f');
